package com.ms3ds.job.task;

import com.ms3ds.common.core.utils.StringUtils;
import com.ms3ds.deviceData.api.RemoteFootageService;
import com.ms3ds.deviceData.api.RemoteMiningRecordService;
import com.ms3ds.deviceData.api.RemoteMovingDataService;
import com.ms3ds.deviceData.api.RemoteSensorDataService;
import com.ms3ds.mineInfo.api.RemoteTaskService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时任务
 * 
 * @author zlw
 */
@Component("ms3dsTask")
public class Ms3dsTask
{
    private static final Logger log = LoggerFactory.getLogger(Ms3dsTask.class);
    @Autowired
    private RemoteMiningRecordService remoteMiningRecordService;

    @Autowired
    private RemoteSensorDataService remoteSensorDataService;

    @Autowired
    private RemoteMovingDataService remoteMovingDataService;

    @Autowired
    private RemoteFootageService  remoteFootageService;

    @Autowired
    private RemoteTaskService remoteTaskService;


    /**
     * 生成各种数据
     */
    public void generateAllData()
    {
        log.info("开始生成数据");
        log.info("开始生成矿石开采数据");
        //生成矿石开采数据
        remoteMiningRecordService.generateMiningRecord();
        log.info("生成矿石开采数据结束");

        //生成传感器数据
        log.info("开始生成传感器数据数据");
        remoteSensorDataService.generateFakeData();
        log.info("生成传感器数据结束");

        log.info("开始生成位移数据数据");
        remoteMovingDataService.generateMovingData();
        log.info("生成位移数据完成");

        log.info("开始生成进尺数据");
        remoteFootageService.generateFootageData();
        log.info("生成进尺数据完成");

        log.info("生成数据完成");
    }

    /**
     * 生成月度开采任务
     */
    public void generateMonthTask()
    {
        log.info("开始生成月度开采任务");
        remoteTaskService.generateMonthTask();
        log.info("生成月度开采任务完成");
    }
}
